package com.hwadee.springboot_lx.entity;

import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.time.LocalDate;

@Getter
@Setter
@Entity
@Table(name = "student")
public class Student {
    @Id
    @Column(name = "StudentID", nullable = false)
    private Long id;

    @Column(name = "StudentAccount", nullable = false, length = 50)
    private String studentAccount;

    @Column(name = "StudentName", length = 100)
    private String studentName;

    @Column(name = "BirthDate")
    private LocalDate birthDate;

    @Column(name = "Gender", length = 10)
    private String gender;

    @Column(name = "Password", nullable = false, length = 20)
    private String password;

    @ManyToOne(fetch = FetchType.LAZY, optional = false)
    @JoinColumn(name = "ClassID", nullable = false)
    private Class classID;

}